<template>
	<view class="item2" :style="{width: width + 'rpx'}" @click="click">
		<view class="cover">
			<image :src="item.coverUrl" :style="{width: image_width?image_width:width + 'rpx', height: image_height?image_height:width + 'rpx'}" mode="aspectFill"></image>
		</view>
		<view class="center">
			<view class="nickname limitLineNumOfOne" :style="{width: width + 'rpx'}">{{item.itemName}}</view>
			<view class="price">
				<view class="price_cont" v-if="type=='item'">
					<view class="price_row">
						<jc-price :value="item.sellingPrice" symbolSize='30' valueSize='40' :isBold='false'></jc-price>
					</view>
					<view class="price_row">
						<text style="font-size: 24rpx;">官网价：</text><jc-price :value="item.marketPrice" symbolSize='28' valueSize='30' isDel></jc-price>
					</view>
				</view>
				<view class="price_cont" v-if="type=='activityItem'">
					<view class="price_row">
						<jc-price value="0" symbolSize='30' valueSize='40' :isBold='false'></jc-price>
					</view>
					<view class="price_row">
						<text style="font-size: 24rpx;">官网价：</text><jc-price :value="item.marketPrice" symbolSize='28' valueSize='30' isDel></jc-price>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			item:{
				type: Object,
				default: {}
			},
			type:{
				type: String,
				default: ''
			},
			width: {
				type: [String, Number],
				default: '345'
			},
			image_width: {
				type: [String, Number],
				default: ''
			},
			image_height: {
				type: [String, Number],
				default: ''
			}
		},
		data() {
			return {
			}
		},
		mounted() {
			
		},
		methods:{
			click(){
				this.$emit("click", this.item)
			},
			
		},
	}
</script>

<style lang="scss" scoped>
	.item2{
		width: 100%;
		margin-left: 20rpx;
		display: flex;
		margin-top: $uni-spacing-row-base;
		flex-direction: column;
		background-color: #FFFFFF;
		// border-top-left-radius: 20rpx;
		// border-top-right-radius: 20rpx;
		.cover{
			position: relative;
			image{
				background-color: #E5E5E5;
				// border-top-left-radius: 20rpx;
				// border-top-right-radius: 20rpx;
			}
			text{
				position: absolute;
				right: 0;
				bottom: 0;
				border-top-left-radius: 20rpx;
				background-color: $st-color-primary;
				color: #FFFFFF;
				font-weight: bold;
				font-size: 24rpx;
				padding: 10rpx 18rpx;
			}
		}
		.center{
			width: 313rpx;
			display: flex;
			flex-direction: column;
			align-items: flex-start;
			margin-left: 16rpx;
			padding-bottom: 16rpx;
			.nickname{
				font-size: 30rpx;
			}
			.price{
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				align-items: center;
				margin-top: 16rpx;
				.bean{
					font-size: 32rpx;
					font-weight: bold;
					color: $st-color-primary;
				}
				.price_cont{
					display: flex;
					flex-direction: column;
					.price_row{
						display: flex;
						flex-direction: row;
						align-items: center;
					}
				}
			}
			
		}
	}
</style>
